export function debounce(fun, delay=400) {
	let timer = null
	
	return function (...args) {
		if(timer) clearTimeout(timer)
		timer = setTimeout(() => {
			fun.apply(this, args)
		},delay)
	}
}
